Closed
Bug 1335324
Opened 8 years ago
Closed 8 years ago
dom/svg/SVGPathData.cpp:210:10: warning: taking the max of unsigned zero and a value is always equal to the other value [-Wmax-unsigned-zero]
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: m_kato, Assigned: Sylvestre)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
When using clang 4.0, the following warning occurs.
1:04.31 In file included from /mozilla/objdir-ib/dom/svg/Unified_cpp_dom_svg5.cpp:74:
1:04.31 Warning: -Wmax-unsigned-zero in /mozilla/mozilla-inbound/dom/svg/SVGPathData.cpp: taking the max of unsigned zero and a value is always equal to the other value
1:04.31 /mozilla/mozilla-inbound/dom/svg/SVGPathData.cpp:210:10: warning: taking the max of unsigned zero and a value is always equal to the other value [-Wmax-unsigned-zero]
1:04.31 return std::max(0U, segIndex - 1); // -1 because while loop takes us 1 too far
1:04.31 ^~~~~~~~ ~~
1:04.31 /mozilla/mozilla-inbound/dom/svg/SVGPathData.cpp:210:10: note: remove call to max function and unsigned zero argument
1:04.31 return std::max(0U, segIndex - 1); // -1 because while loop takes us 1 too far
1:04.31 ^~~~~~~~ ~~~
Comment 1•8 years ago
|
||
presumably std::max(1U, segIndex) - 1; is what's really required here.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → sledru
Blocks: clang-based-analysis
Assignee | ||
Updated•8 years ago
|
Attachment #8834009 -
Flags: review?(peterv)
![]() |
||
Comment 3•8 years ago
|
||
mozreview-review |
Comment on attachment 8834009 [details]
Bug 1335324 - Fix a -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u)
https://reviewboard.mozilla.org/r/110120/#review111164
Attachment #8834009 -
Flags: review+
![]() |
||
Updated•8 years ago
|
Attachment #8834009 -
Flags: review?(peterv)
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8598941437bf
Fix a -Wmax-unsigned-zero warnings (std::max(unsigned int, 0u) r=jwatt
Comment 5•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Assignee | ||
Updated•7 years ago
|
Blocks: build-clang-trunk
Assignee | ||
Updated•7 years ago
|
No longer blocks: clang-based-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•